package com.huluobo.a2107kotlinshopping.home

import android.view.LayoutInflater
import android.view.ViewGroup
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.huluobo.a2107kotlinshopping.R
import com.huluobo.a2107kotlinshopping.databinding.ItemNavBinding

/**
 *  Created by LC on 2023/11/16.
 */
class NavAdapter(list: MutableList<HomeNavBean>) :
    BaseQuickAdapter<HomeNavBean, NavAdapter.NavViewHolder>(R.layout.item_nav, list) {
    class NavViewHolder(var binding: ItemNavBinding) : BaseViewHolder(binding.root)

    override fun convert(helper: NavViewHolder, item: HomeNavBean) {
        helper.binding.navBean = item
    }

    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): NavViewHolder {
        val databinding = ItemNavBinding.inflate(LayoutInflater.from(parent.context), parent, false)
        return NavViewHolder(databinding)
    }
}